<template>
	<!-- 项目 -->
	<view class="upload">
		<uniTabs :tabs="tabs" :activeTab="activeTab" lineHeight="false" @change="change" activeColor="#DD524D" class="tabs"></uniTabs>
	<!-- 	<view class="" v-show="activeTab===0">
			<view class="top">
				<text class="nav">项目信息</text>
				<view class="">
					<text>项目名称：</text>
					<text>南京大学食堂及宿舍楼改建工程</text>
				</view>
				<view class="">
					<text>项目简称：</text>
					<text>南大项目</text>
				</view>
				<view class="">
					<text>项目类型：</text>
					<text>房屋建筑工程</text>
				</view>
				<view class="">
					<text>项目地址：</text>
					<text>苏州市XXX</text>
				</view>
				<view class="">
					<text>项目工期：</text>
					<text>2020-01至2021-04-01</text>
				</view>
				<view class="">
					<text>项目经理：</text>
					<text>吴先生</text>
				</view>
				<view class="">
					<text>项目简介：</text>
					<text></text>
				</view>
			</view>
		</view> -->

		<view class="" v-show="activeTab==0">
			<view class="footer" v-for="(item,index) in projectData">
				<text class="ttt">{{item.name}}</text>
				<text class="ccc">{{userinfo.name}}</text>
				<text class="ccc">{{item.engineering_cycle}}</text>
			</view>
		</view>
		<image v-if="projectData.length<1"  style="position: absolute;top:0;left: 0;bottom: 0;right: 0;margin: auto;width: 600rpx;" src="../../../static/image/no-data.png" mode=""></image>
	</view>
</template>

<script>
	import uniTabs from '@/components/v-tabs/v-tabs.vue'
	import api from '@/static/js/api.js'
	export default {
		components: {
			uniTabs
		},

		data() {
			return {
				tabs: [
					// '当前项目',
					'往期项目',
				],
				activeTab: 0,
				projectData:'',
				userinfo:''
			}
		},
      onShow() {
		  this.userinfo = JSON.parse(uni.getStorageSync('userInfo'));
		  api.classProject('jhj.team','_api_public_jhj_team_browse_one',this.userinfo.team_id).then(res=>{
			  this.projectData = res.data.project_list
		  }).catch(e => {
         	uni.showToast({
         		icon: 'none',
         		title: e.message
         	})
         })
      },
		methods: {
			change(index) {
				this.activeTab = index
			}
		}

	}
</script>

<style lang="less" scoped>
	.upload {
		width: 100%;
		background-color: #EBEEF5;
		min-height: 100vh;
	}

	.tabs {
		position: relative;
	}

	/deep/ .v-tabs {
		width: 100%;
		height: 100rpx;
		background-color: #FFFFFF;
		line-height: 100rpx;
	}

	/deep/ .v-tabs__container-item {
		width: 100%;
		justify-content: center;
	}

	.top {
		font-size: 28rpx;
		margin-top: 20rpx;
		background-color: #FFFFFF;

		.nav {
			display: block;
			padding: 30rpx;
			color: #DD524D;
			font-size: 30rpx;
			font-weight: 600;
		}

		view {
			padding: 15rpx 40rpx;
			display: flex;
			justify-content: space-between;
		}
	}

	.footer {
		margin-top: 20rpx;
		background-color: #FFFFFF;

		text {
			display: block;
		}

		.ttt {
			font-size: 30rpx;
			padding: 15rpx 40rpx;
		}

		.ccc {
			font-size: 28rpx;
			padding: 15rpx 40rpx;
			color: #808080;
		}
	}
</style>
